package xin.mashibo.genvictobutest.vo;

import android.os.Parcel;
import android.os.Parcelable;

import com.genvict.obusdk.data.CardTransactionRecord;

/**
 * @author MaShibo
 *         on 2018/3/27
 */
public class CardTransactionExtend extends CardTransactionRecord implements Parcelable {

    public CardTransactionExtend(CardTransactionRecord record) {
        setOnlineSn(record.getOnlineSn());
        setOverdrawLimit(record.getOverdrawLimit());
        setTransAmount(record.getTransAmount());
        setTransType(record.getTransType());
        setTerminalNo(record.getTerminalNo());
        setTransDate(record.getTransDate());
        setTransTime(record.getTransTime());
    }

    protected CardTransactionExtend(Parcel in) {
        setOnlineSn(in.readString());
        setOverdrawLimit(in.readString());
        setTransAmount(in.readString());
        setTransType(in.readString());
        setTerminalNo(in.readString());
        setTransDate(in.readString());
        setTransTime(in.readString());
    }

    public static final Creator<CardTransactionExtend> CREATOR = new Creator<CardTransactionExtend>() {
        @Override
        public CardTransactionExtend createFromParcel(Parcel in) {
            return new CardTransactionExtend(in);
        }

        @Override
        public CardTransactionExtend[] newArray(int size) {
            return new CardTransactionExtend[size];
        }
    };

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(getOnlineSn());
        dest.writeString(getOverdrawLimit());
        dest.writeString(getTransAmount());
        dest.writeString(getTransType());
        dest.writeString(getTerminalNo());
        dest.writeString(getTransDate());
        dest.writeString(getTransTime());
    }
}
